/*
   FieldVis - A Tool for Visualizing Astrophysical Magnetohydrodynamic Flow
   
   Copyright (C) 2006 - 2008     FieldVis Development Team
  
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
  
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
  
   You should have received a copy of the GNU General Public License along
   with this program; if not, write to the Free Software Foundation, Inc.,
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

   File        : dimensions.h

   Description : Volume dimensions header file for the flowviewer application.
*/

#ifndef _DIMENSIONS_H_
#define _DIMENSIONS_H_

// a very large value to serve for infinity in comparisons
#define NEAR_INFINITY 100000000.0

// data point dimensions
// data refers to points sampled within plane, slices refers to number of
//   planes, these values differ for X due to interpolation
#define DATA_X_DIM (1000) // from readme.txt, adjusted for interpolation
#define DATA_Y_DIM 1000 // from readme.txt
#define DATA_Z_DIM 1000 // from readme.txt
#define SLICE_X_DIM 100
#define SLICE_Y_DIM 100
#define SLICE_Z_DIM 100
#define MAX_SLICES SLICE_Y_DIM

// volume physical dimensions
#define VOLUME_X_MIN 0.0 
#define VOLUME_X_MAX 1000.0 
#define VOLUME_Y_MIN 0.0 
#define VOLUME_Y_MAX 1000.0 
#define VOLUME_Z_MIN 0.0 
#define VOLUME_Z_MAX 1000.0 
#define VOLUME_X_DIM (VOLUME_X_MAX - VOLUME_X_MIN)
#define VOLUME_Y_DIM (VOLUME_Y_MAX - VOLUME_Y_MIN)
#define VOLUME_Z_DIM (VOLUME_Z_MAX - VOLUME_Z_MIN)
#define VOLUME_MAX_DIM VOLUME_X_DIM
#define PHYS_SCALE_FACTOR 0.001
#define PHYS_SCALE_FACTOR_INVERSE 1000.0

// scaled physical dimensions
#define VOL_PHYS_X_MIN (VOLUME_X_MIN * PHYS_SCALE_FACTOR)
#define VOL_PHYS_Y_MIN (VOLUME_Y_MIN * PHYS_SCALE_FACTOR)
#define VOL_PHYS_Z_MIN (VOLUME_Z_MIN * PHYS_SCALE_FACTOR)
#define VOL_PHYS_X_DIM (VOLUME_X_DIM * PHYS_SCALE_FACTOR)
#define VOL_PHYS_Y_DIM (VOLUME_Y_DIM * PHYS_SCALE_FACTOR)
#define VOL_PHYS_Z_DIM (VOLUME_Z_DIM * PHYS_SCALE_FACTOR)
#define VOL_PHYS_X_MAX (VOL_PHYS_X_MIN + VOL_PHYS_X_DIM)
#define VOL_PHYS_Y_MAX (VOL_PHYS_Y_MIN + VOL_PHYS_Y_DIM)
#define VOL_PHYS_Z_MAX (VOL_PHYS_Z_MIN + VOL_PHYS_Z_DIM)

// TODO: optimize this value though testing (should be as small as possible
//   while guaranteeing that object selection using mouse works properly)
#define HASH_VOXEL_SIZE (VOLUME_X_DIM * PHYS_SCALE_FACTOR / DATA_X_DIM * 1.5)

#endif // _DIMENSIONS_H_
